
package loader;

import java.io.IOException;
import java.io.InputStream;

/**
 * 使用 ClassLoader 的方式, 來取得 input stream<br>
 * <br>
 * Copyright: Copyright (c) 2001-2007<br>
 * Company: 一零四資訊科技股份有限公司
 * 
 * @author Eric.Kao(eric.kao@104.com.tw)
 * @version 1.0
 */
public class TestClassLoader
{
	public TestClassLoader() throws IOException
	{
		String str = "config/test.txt";

		ClassLoader loader = TestClassLoader.class.getClassLoader();

		InputStream in = loader.getResourceAsStream( str );

		System.out.println( "in:" + in );
	}

	public static void main( String[] args )
	{
		try
		{
			new TestClassLoader();
		}
		catch( IOException ex )
		{
			ex.printStackTrace();
		}
	}
}
